import {createRouter, createWebHashHistory} from "vue-router";

const routes = [
    {
        path: "/",
        name: "index",
        redirect: "/front/frontList"
    },
    {
        path: "/regest",
        name: "regest",
        component: () => import("@/components/RegestComp.vue"),
    },
    {
        path: "/adminlogin",
        name:"adminlogin",
        component: () =>import("@/components/admin/LoginVue")
    },
    {
        path: "/login",
        name: "login",
        component: () => import("@/components/front/HomeView.vue")
    },
    {
        path: "/admin",
        name: "admin",
        component: () => import("@/components/admin/AdminIndex.vue"),
        //这里是子组件，你写的管理员components都要写在这里
        children: [
            {
                //这是第一个子页面，其他的可以复制这里面的
                //注意，这里(path)最前面不加 /
                //用户列表子页面
                path:"userlist",
                component:() => import("@/components/admin/UserList")
            },
            {
                //后台新闻子页面
                path: "newslist",
                component: () => import("@/components/admin/NewsList"),
            },
            {
                //后台捐赠子页面
                path: "donatelist",
                component:() => import("@/components/admin/DonateList")
            },
            {
               //后台求助子页面
                path: "helplist",
                component:() => import("@/components/admin/HelpList")
            },
            {
                //后台捐钱子页面
                path: "adoptlist",
                component: ()=> import("@/components/admin/MoneyList")
            },
            {
                //后台活动子页面
                path: "activitylist",
                component: () => import("@/components/admin/ActivityList")
            },
            {
                //后台宠物子页面
                path: "animallist",
                component: () => import("@/components/admin/AnimalList")
            },
            {
                //后台新闻评论子页面
                path: "NewsReview",
                component: () => import("@/components/admin/NewsReview")
            },
            {
                //后台个人求助评论子页面
                path: "AssReview",
                component: () => import("@/components/admin/AssReview")
            },
            {
                //后台举报子页面
                path: "reportlist",
                component: () => import("@/components/admin/ReportList")
            }

        ]
    },
    //----------------------------------下面不用管------------------------------------
    {
        path: "/front",
        name: "front",
        component: () => import("@/components/front/FrontIndex.vue"),
        //这里是子组件，你写的前端components都要写在这里
        children: [
            {
                path: "paysuccess",
                name: "paysuccess",
                component: () => import("@/components/PaySuccess.vue"),
            },
            {
                path: "newsDetail/:id",
                component: () => import("@/components/front/news/NewsDetail.vue")
            },
            {
                //这是第一个子页面，其他的可以复制这里面的
                //注意，这里(path)最前面不加 /
                path: "frontList",
                component: () => import("@/components/front/FrontList"),
            },
            {
                path: "addNews",
                component: () => import("@/components/front/news/AddNews.vue")
            },
            {
                path: "donate",
                component: () => import("@/components/front/doinate/DonateParent.vue"),
                children: [
                    {
                        path: "DonateGoods",
                        component: () => import("@/components/front/doinate/DonateGoods.vue")
                    },
                    {
                        path: "DonateMoney",
                        component: () => import("@/components/front/doinate/DonateMoney.vue")
                    },
                ]
            },
            {
                path: "assindex",
                component: () => import("@/components/front/AssisNav.vue"),
                children: [
                    {
                        path: "asstanceList",
                        component: () => import("@/components/front/help/AsstanceList.vue"),
                    },
                    {
                        path: "asstanceDetail/:aid",
                        component: () => import("@/components/front/help/AsstanceDetail.vue"),
                    },
                    {
                        path: "donateAdd",
                        component: () => import("@/components/front/doinate/DonateAdd.vue"),
                    },
                    {
                        path: "helpList",
                        component: () => import("@/components/front/help/HelpList.vue"),
                    },
                    {
                        /*公益捐赠信息发布页面*/
                        path: "asstanceAdd",
                        component: () => import("@/components/front/help/AsstanceAdd.vue"),
                    },
                ]
            },
            {
                path: "addVolunte",
                component: () => import("@/components/front/volunteer/AddVolunte.vue")
            },
            {
                path: "addPet",
                component: () => import("@/components/front/pet/AddPet.vue")
            },
            {
                path: "userInfo",
                component: () => import("@/components/front/user/UserInfor.vue"),
                children: [
                    {
                        path: "userIndex",
                        component: () => import("@/components/front/user/UserIndex.vue")
                    },
                    {
                        path: "userNews",
                        component: () => import("@/components/front/user/UserNews.vue")
                    },
                    {
                        path: "userAssis",
                        component: () => import("@/components/front/user/UserHelpNac.vue"),
                        children: [
                            {
                                path: "UserAss",
                                component: () => import("@/components/front/user/UserAss.vue")
                            },
                            {
                                path: "UserHelp",
                                component: () => import("@/components/front/user/UserHelp.vue")
                            },
                        ]
                    },
                    {
                        path: "UserPet",
                        component: () => import("@/components/front/user/UserPet.vue")
                    },
                    {
                        path: "UserVolunte",
                        component: () => import("@/components/front/user/UserVolunte.vue"),
                        children: [
                            {
                                path: "mycreate",
                                component: () => import("@/components/front/user/CreateVolunte.vue")
                            },
                            {
                                path: "myjoin",
                                component: () => import("@/components/front/user/JoinVolunte.vue")
                            },
                        ]
                    },
                    {
                        path: "donate",
                        component: () => import("@/components/front/user/UserDoinate.vue"),
                        children: [
                            {
                                path: "donateMoney",
                                component: () => import("@/components/front/user/DonateMoney.vue")
                            },
                            {
                                path: "donateGoods",
                                component: () => import("@/components/front/user/DonateGoods.vue")
                            },
                        ]
                    },
                ]
            },

            {     /*公益捐赠信息列表*/
                path: "asstanceList",
                component: () => import("@/components/front/help/AsstanceList.vue"),
            },
            {
                /*订单信息填写(暂时没用）*/
                path: "donateAdd",
                component: () => import("@/components/front/doinate/DonateAdd.vue"),
            },
            {
                /*个人求助信息列表*/
                path: "helpList",
                component: () => import("@/components/front/help/HelpList.vue"),
            },
            {
                /*个人求助信息详情*/
                path: "helpDetail/:hid",
                component: () => import("@/components/front/HelpDetail"),
            },
            {
                /*志愿活动信息列表*/
                path: "volunteerList",
                component: () => import("@/components/front/VolunteerList"),
            },
            {      /*志愿活动信息详情*/
                path: "volunteerDetail/:vid",
                component: () => import("@/components/front/VolunteerDetail"),
            },
            {
                /*宠物领养信息列表*/
                path: "petList",
                component: () => import("@/components/front/pet/PetList.vue"),
            },
            {      /*宠物信息详情*/
                path: "petDetail/:pid",
                component: () => import("@/components/front/pet/PetDetail.vue"),
            },
            {      /*宠物信息详情*/
                path: "canpanyAdd",
                component: () => import("@/components/front/CanpanyAdd"),
            },
            {      /*公示页面*/
                path: "publicity",
                component: () => import("@/components/front/doinate/DonatePublicity.vue"),
            },
        ]
    }
]

const myrouter = createRouter({
    history: createWebHashHistory(),
    routes
})
export default myrouter